package com.tongji.housediy.controller.CantavilCMD
{
	import com.tongji.housediy.events.CantavilEvent.GetCantavilDetailEvent;
	import com.tongji.housediy.model.CantavilDropDownListModel;
	import com.tongji.housediy.service.CantavilService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author chenzhongyuan
	 * 2011-9-12
	 */
	
	public class GetCantavilDetailCmd extends Command
	{
		[Inject]
		public var service:CantavilService;
		
		[Inject]
		public var model:CantavilDropDownListModel;
		
		[Inject]
		public var event:GetCantavilDetailEvent;
		
		override public function execute():void
		{
			switch (event.type)
			{
				case GetCantavilDetailEvent.GET_CANTAVIL_DETAIL:
					service.getCantavilDetail(event.typeID);
					break;
				case GetCantavilDetailEvent.UPDATE_CANTAVIL_DETAIL:
					model.updateCantavilDetail(event.cantavilModel);
					break;
			}			
		}
	}
}